package com.ze.commontool;

import android.content.Context;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnCompletionListener;


public class SoundPlayer {
	public static MediaPlayer mediaPlayer = null;
	public static void play( Context context,  int res_sound )
	{
		mediaPlayer = MediaPlayer.create(context,res_sound );
		if( mediaPlayer != null )
		{
			mediaPlayer.start();
		}
		mediaPlayer.setOnCompletionListener(new OnCompletionListener() {
			
			@Override
			public void onCompletion(MediaPlayer mp) {
				// TODO Auto-generated method stub
				mediaPlayer.release();
			}
		});
	}
}
